home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
dll_gen
/
strplus
/
tokens.frm
< prev
next >
Wrap
Text File
|
1994-07-19
|
3KB
|
83 lines
VERSION 2.00
Begin Form Tokens
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Tokens"
ClientHeight = 5460
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 7590
ControlBox = 0 'False
Height = 5865
Left = 1035
LinkTopic = "Form2"
ScaleHeight = 5460
ScaleWidth = 7590
Top = 1140
Width = 7710
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "O &K A Y"
Height = 375
Left = 1800
TabIndex = 1
Top = 4800
Width = 3975
End
Begin Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Label1"
ForeColor = &H00000080&
Height = 1335
Left = 840
TabIndex = 0
Top = 3360
Width = 5895
End
End
Dim TheseAnimals$()
Dim AnimalCount As Integer
Dim TheseFruit$()
Dim FruitCount As Integer
Sub Command1_Click ()
Unload Me
End Sub
Sub Form_Load ()
FormCenterScreen Me
DataAnimals$ = "cat,dog,bat,aardvark,frog,elephant"
'TheseAnimals$() was declared as an open array in the 'general' procedure
'DataAnimals$ is the string with the data elements
'AnimalCount will contain the total count of elements upon completion
ReadData TheseAnimals$(), DataAnimals$, AnimalCount
'the elements are printed in the Paint event
SortArray TheseAnimals$(), LBound(TheseAnimals$), UBound(TheseAnimals$)
DataFruit$ = "banana,apple,cherry,date"
ReadData TheseFruit$(), DataFruit$, FruitCount
SortArray TheseFruit$(), LBound(TheseFruit$), UBound(TheseFruit$)
nl$ = Chr$(13) + Chr$(10)
msg$ = "These two lists were read as Data in a very similar" + nl$
msg$ = msg$ + "manner to the old BASIC Data/Read statements. This" + nl$
msg$ = msg$ + "is accomplished by FIRST declaring the array with an open" + nl$
msg$ = msg$ + "dimension, e.g., dim Array$(). Then, use the ReadData Sub" + nl$
msg$ = msg$ + "(which uses the StrPlus.DLL GetToken Sub) to actually read" + nl$
msg$ = msg$ + "each item into the array."
label1.Caption = msg$
Screen.MousePointer = 0
End Sub
Sub Form_Paint ()
DoForm3D Me, sunken, 2, 5
Print
For x = 1 To AnimalCount: Print , TheseAnimals$(x): Next
Print : Print
For x = 1 To FruitCount: Print , TheseFruit$(x): Next
End Sub